package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementBusiMtngroupPortMapper;
import com.ruoyi.net.domain.ElementBusiMtngroupPort;
import com.ruoyi.net.service.IElementBusiMtngroupPortService;

/**
 * 网元-业务-mtngroup-端口信息Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementBusiMtngroupPortServiceImpl implements IElementBusiMtngroupPortService 
{
    @Autowired
    private ElementBusiMtngroupPortMapper elementBusiMtngroupPortMapper;

    /**
     * 查询网元-业务-mtngroup-端口信息
     * 
     * @param id 网元-业务-mtngroup-端口信息主键
     * @return 网元-业务-mtngroup-端口信息
     */
    @Override
    public ElementBusiMtngroupPort selectElementBusiMtngroupPortById(String id)
    {
        return elementBusiMtngroupPortMapper.selectElementBusiMtngroupPortById(id);
    }

    /**
     * 查询网元-业务-mtngroup-端口信息列表
     * 
     * @param elementBusiMtngroupPort 网元-业务-mtngroup-端口信息
     * @return 网元-业务-mtngroup-端口信息
     */
    @Override
    public List<ElementBusiMtngroupPort> selectElementBusiMtngroupPortList(ElementBusiMtngroupPort elementBusiMtngroupPort)
    {
        return elementBusiMtngroupPortMapper.selectElementBusiMtngroupPortList(elementBusiMtngroupPort);
    }

    /**
     * 新增网元-业务-mtngroup-端口信息
     * 
     * @param elementBusiMtngroupPort 网元-业务-mtngroup-端口信息
     * @return 结果
     */
    @Override
    public int insertElementBusiMtngroupPort(ElementBusiMtngroupPort elementBusiMtngroupPort)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiMtngroupPort.getId())) {
            elementBusiMtngroupPort.setId(uuid);
        }
        elementBusiMtngroupPort.setCreateBy(SecurityUtils.getUsername());
        elementBusiMtngroupPort.setCreateTime(DateUtils.getNowDate());
        elementBusiMtngroupPort.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMtngroupPort.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMtngroupPortMapper.insertElementBusiMtngroupPort(elementBusiMtngroupPort);
    }

    /**
     * 修改网元-业务-mtngroup-端口信息
     * 
     * @param elementBusiMtngroupPort 网元-业务-mtngroup-端口信息
     * @return 结果
     */
    @Override
    public int updateElementBusiMtngroupPort(ElementBusiMtngroupPort elementBusiMtngroupPort)
    {
        elementBusiMtngroupPort.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMtngroupPort.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMtngroupPortMapper.updateElementBusiMtngroupPort(elementBusiMtngroupPort);
    }

    /**
     * 批量删除网元-业务-mtngroup-端口信息
     * 
     * @param ids 需要删除的网元-业务-mtngroup-端口信息主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMtngroupPortByIds(String[] ids)
    {
        return elementBusiMtngroupPortMapper.deleteElementBusiMtngroupPortByIds(ids);
    }

    /**
     * 删除网元-业务-mtngroup-端口信息信息
     * 
     * @param id 网元-业务-mtngroup-端口信息主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMtngroupPortById(String id)
    {
        return elementBusiMtngroupPortMapper.deleteElementBusiMtngroupPortById(id);
    }
}
